//
//  XLMyFriendTableCell.m
//  XiangLove
//
//  Created by 李传坤 on 2018/7/20.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLMyFriendTableCell.h"

@implementation XLMyFriendTableCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupView];
    }
    return self;
}
- (void)setupView{
    _headerImageView = [[UIImageView alloc] init];
    _headerImageView.layer.cornerRadius = 5;
    _headerImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:_headerImageView];
    [_headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(48, 48));
        make.left.equalTo(self.contentView.mas_left).offset(11);
        make.centerY.equalTo(self.contentView);
    }];
    
    _nickNameLabel = [[UILabel alloc] init];
    _nickNameLabel.font = [UIFont systemFontOfSize:18];
    _nickNameLabel.textColor = RGB_HEX(0x000000);
    [self.contentView addSubview:_nickNameLabel];
    [_nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(65);
        make.top.equalTo(self.contentView.mas_top).offset(19);
        make.right.equalTo(self.contentView.mas_right).offset(-50);
    }];
    
    _ageLabel = [[UILabel alloc] init];
    _ageLabel.font = [UIFont systemFontOfSize:13];
    _ageLabel.textAlignment = NSTextAlignmentLeft;
    _ageLabel.textColor = RGB_HEX(0xffffff);
    _ageLabel.layer.cornerRadius = 8;
    _ageLabel.clipsToBounds = YES;
    [self.contentView addSubview:_ageLabel];
    
    self.sexImage = [[UIImageView alloc]init];
    [self.contentView addSubview:_sexImage];
    
    self.levelImage = [[UIImageView alloc]init];
    [self.contentView addSubview:_levelImage];
    
    _isFriend = [[UILabel alloc] init];
    _isFriend.font = [UIFont systemFontOfSize:13];
    _isFriend.textAlignment = NSTextAlignmentCenter;
    _isFriend.textColor = RGB_HEX(0xffffff);
    _isFriend.backgroundColor = RGB_HEX(0xFFCD43);
    _isFriend.layer.cornerRadius = 8;
    _isFriend.clipsToBounds = YES;
    _isFriend.text = @"好友";
    [self.contentView addSubview:_isFriend];

    _infor = [[UILabel alloc] init];
    _infor.textColor = kLightGrayColor;
    _infor.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_infor];
    [_infor mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nickNameLabel.mas_left);
        make.top.equalTo(self.nickNameLabel.mas_bottom).offset(5);
        make.right.equalTo(self.contentView.mas_right).offset(-50);
    }];
    _onlineState = [[UILabel alloc] init];
    _onlineState.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_onlineState];
    [_onlineState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-14);
        make.centerY.equalTo(self.contentView);
        
    }];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
